import groovy.json.*


def json = new JsonBuilder()
json.state{
   capital "Denver"
   majorCities "Denver", "Colorado Springs", "Fort Collins"
}
// println json

def str = '''
{"person":{"name":"Guillaume","age":33,"pets":["Hector","Felix"]}}
'''

println JsonOutput.prettyPrint(str)

println JsonOutput.toJson(false);

